package com.chenglai.order.rabbitmq;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author yawang
 * @create 2023/11/27 16:47:22
 * 普通订单走的队列
 **/
@Component
public class MqServer {
    @Resource
    private RabbitTemplate rabbitTemplate;

    public void sendOrderMessage(Object data){
        //预下单发送消息
        System.out.println(data);
        rabbitTemplate.convertAndSend("orderExchange","orderMessage",data);

    }
}
